#ifndef MTEXT_H
#define MTEXT_H
#include "point.h"
#include "mouseoperation.h"
namespace Entities
{
class MText : public Entity,public MouseOperation
{
public:
    MText();
    MText(const Point&p1,std::string mtext);
    MText(const Point&p1,std::string mtext,double angle, std::string unicode);
    MText(const MText& mText);
    ~MText();
private:
    double m_x;
    double m_y;
    double m_z;
    double m_drawableX;
    double m_drawableY;
    double m_drawableZ;
    /*! text */
    std::string m_text;
    /*! Points */
    Point m_p;
    /**旋转角度*/
    double m_angle
    /**编码格式*/;
    std::string m_unicode;
public:
    virtual void printInfo();
    virtual EntityType GetType(){return EntityType::MTextType;}
    virtual void Draw(QPainter& painter);
    virtual void writeDxfInfo(DL_Dxf &dxf,DL_WriterA* dw);
    virtual Entity* Clone();
    virtual void Transform(double*params,int size=9);
    virtual void Scale(double ratio);
    virtual void Transfer(double dx,double dy,double dz);
    virtual void Rotate(double angle,double cx,double cy,double cz);
    virtual const std::string  ToString(){return "MText";}
    virtual void CorrectCoord(double bx,
                              double by,
                              double bz,
                              double sx,
                              double sy,
                              double sz,
                              double rotaAngle);
public:
    std::string GetText()const{return m_text;}
    const Point  GetPt()const {return m_p;}

    double GetAngle()const{return m_angle;}
    void SetAngle(double angle) { m_angle = angle;}
    std::string GetUnicode()const{return m_unicode;}

    void SetX(double x){m_x=x;}
    double GetX() const{return m_x;}

    void SetY(double y){m_y=y;}
    double GetY() const{return m_y;}

    void SetZ(double z){m_z=z;}
    double GetZ() const{return m_z;}


    double GetDrawableX() const{return m_drawableX;}

    double GetDrawableY() const{return m_drawableY;}

    double GetDrawableZ() const{return m_drawableZ;}

    void SetDrawableX(double x) { m_drawableX=x;}

    void SetDrawableY(double y) { m_drawableY=y;}

    void SetDrawableZ(double z) { m_drawableZ=z;}
};
}


#endif // MTEXT_H
